const columnDesObjs = Array.of(
  { key: 'materialItemName', label: '物料名' },
  { key: 'quantity', label: '单位用量' },
  { key: 'materialItemCode', label: '材料编码' },
  { key: 'formulaName', label: '计算公式' },
  { key: 'formulaId', label: '计算用量公式ID', isDefaultShowDynamicColumn: false },
  { key: 'techId', label: '工序ID', isDefaultShowDynamicColumn: false },
  { key: 'materialItemId', label: '物料ID', isDefaultShowDynamicColumn: false },
  { key: 'productId', label: '产品或者半成品ID', isDefaultShowDynamicColumn: false },
  { key: 'productMatetialId', label: '产品物理关系ID', isDefaultShowDynamicColumn: false }
)

//  vo转换
const transformMaterialItemVO = (materialItem) => {
  // console.log(materialItem)
  const { Name, MaterialItemID, ...other } = materialItem
  return {
    ...other,
    materialItemID: MaterialItemID,
    materialItemName: Name
  }
}

const materialFactory = ({
                           productId,
                           materialItemID, techId, materialItemName
                         } = {}) => ({
  formulaName: '面积',
  // formulaName: '',
  formulaId: 1,// 设置一个默认的
  // formulaId: 0,// 设置一个默认的
  productMatetialId: -1,
  quantity: 1,  //  默认数量为 1
  techId,
  materialItemID,
  materialItemName,
  productId,
})

export { columnDesObjs, materialFactory,transformMaterialItemVO }
